﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Entity;
using BLL;

namespace web.admin.InnerCon
{
    public partial class InnerPictures : System.Web.UI.Page
    {
        PhotoService photoService = new PhotoService();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string id = Request["id"];
                if (String.IsNullOrEmpty(id))
                    return;

                btn_Add.NavigateUrl = "AddInnerPicture.aspx?ProcedureId=" + id;

                BoProcedures proc = new BoProcedures();
                proc.PRO_ID = id;
                IList<BoPhotos> photos = photoService.GetProcedurePhotos(proc);
                foreach (BoPhotos p in photos)
                {
                    p.PHO_URL = "/UploadImages/" + p.PHO_URL;
                }

                DataList1.DataSource = photos;
                DataList1.DataBind();
            }
        }
    }
}